﻿using BLL;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BONGDA
{
    public partial class NEWLEAGUE : Form
    {
        public NEWLEAGUE()
        {
            InitializeComponent();
        }

        private void visiblePanelL()
        {
            pnlLhome.Visible = false;
            pnlLcauthu.Visible = false;
            pnlLdoibong.Visible = false;
            pnlLlichthidau.Visible = false;
            pnlLsanvandong.Visible = false;
            pnlLtrongtai.Visible = false;
        }
        private void btnHome_Click(object sender, EventArgs e)
        {
            panelShow.Controls.Clear();
            visiblePanelL();         
        }

        private void btnDoiBong_Click(object sender, EventArgs e)
        {
            frmAddClubs frm = new frmAddClubs();
            frm.TopLevel = false;
            frm.AutoScroll = true;
            frm.FormBorderStyle = FormBorderStyle.None;
            panelShow.Controls.Clear();
            this.panelShow.Controls.Add(frm);
            frm.Show();

            visiblePanelL();
            pnlLdoibong.Visible = true;
        }

        private void btnCauThu_Click(object sender, EventArgs e)
        {
            frmOutFootballer frm = new frmOutFootballer();
            frm.TopLevel = false;
            frm.AutoScroll = true;
            frm.FormBorderStyle = FormBorderStyle.None;
            panelShow.Controls.Clear();
            this.panelShow.Controls.Add(frm);
            frm.Show();

            visiblePanelL();
            pnlLcauthu.Visible = true;
        }

        private void btnLichThiDau_Click(object sender, EventArgs e)
        {
            frmMatch frm = new frmMatch();
            frm.TopLevel = false;
            frm.AutoScroll = true;
            frm.FormBorderStyle = FormBorderStyle.None;
            panelShow.Controls.Clear();
            this.panelShow.Controls.Add(frm);
            frm.Show();

            visiblePanelL();
            pnlLlichthidau.Visible = true;
        }

        private void btnTrongTai_Click(object sender, EventArgs e)
        {
            frmReferee frm = new frmReferee();
            frm.TopLevel = false;
            frm.AutoScroll = true;
            frm.FormBorderStyle = FormBorderStyle.None;
            panelShow.Controls.Clear();
            this.panelShow.Controls.Add(frm);
            frm.Show();

            visiblePanelL();
            pnlLtrongtai.Visible = true;
        }

        private void btnSan_Click(object sender, EventArgs e)
        {
            frmTours frm = new frmTours();
            frm.TopLevel = false;
            frm.AutoScroll = true;
            frm.FormBorderStyle = FormBorderStyle.None;
            panelShow.Controls.Clear();
            this.panelShow.Controls.Add(frm);
            frm.Show();

            visiblePanelL();
            pnlLsanvandong.Visible = true;
        }

        private void xButton1_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            DataTable dt = LichThiDau_BLL.SelectbyVong(1);
            if (dt.Rows.Count == 0)
            {
                MessageBox.Show("Chưa lập lịch thi đấu!", "Thông báo",
                                MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            else
            {
                this.Hide();
                frmLogin frm = new frmLogin();
                frm.ShowDialog();
                this.Close();
            }
        }
    }
}
